package mains;

import cartes.Carte;

import cartes.Denomination;

import mains.RangPoker;
import mains.ReqAnalyseMain;

import rangs.RangBrelan;
import rangs.RangQuintuplet;

public class Quintuplet extends AbstractAnalyseurRang{
	public Quintuplet() {
		super();
	}

	public boolean reconnaitreMain(ReqAnalyseMain requete) {
	  Main m = hasSameDenominationNTimes(requete.getMain(),5);
	  if(m != null){
		  RangQuintuplet quintuplet = new RangQuintuplet();
		  quintuplet.setQuintuplet(m);
		  
		  Main reste = requete.getMain();
		  requete.getMain().removeAll(m);
		  quintuplet.setReste(reste);

		  requete.setRangReconnu(quintuplet);
		  return true; 
	  }
	  return false;
	}
	
	public RangPoker getRang() {
		return RangPoker.QUINTUPLET;
	}
}
